<ion-view view-title="基金理财">
    <ion-nav-buttons side="left">
        <back-button></back-button>
        <a ng-href="#/tab/search" class="btnSearch"></a>
    </ion-nav-buttons>
    <ion-nav-buttons  side="right">
        <a ng-show="vm.showOrder" ng-click="show()"  style="right:50px" class="button button-clear icon-right">排序</a>
    </ion-nav-buttons>
    <div class="bar clearfix has-header" style="height: initial;padding:0" ng-class="{'has-loading': isOffline}">
        <input type="checkbox" class="ion-scroll-toggle" ng-model="vm.showType" id="showButton">
        <ion-scroll direction="x" scrollbar-x="false" delegate-handle="sonScroll" ng-class="{kTab:!vm.showType}" >
            <div class="kTab clearfix" ng-show="!vm.showType">
                <a ng-click="vm.activeTab= channel.id;vm.price_increase_qry_type=0" ng-class="{current: vm.activeTab == channel.id}"
                   id="{{channel.id}}" ng-repeat="channel in channels">{{channel.catalog_name}}</a>
            </div>
            <div class="kTab clearfix" ng-show="vm.showType">
                <a ng-click="vm.activeTab= channel.id;vm.showType=!vm.showType;vm.price_increase_qry_type=0" ng-class="{current: vm.activeTab == channel.id}"
                   ng-repeat="channel in channels" >{{channel.catalog_name}}</a>
            </div>
        </ion-scroll>
    </div>
    <ion-content scroll-to-top="1" class="has-subheader" delegate-handle="scroller" ng-class="{'has-loading': isOffline}">
        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>
        <div class="kCells kMyProduct fund" style="margin-top: 10px;" ng-show="vm.activeTab == channel.id" ng-repeat="channel in channels">
            <div class="kCell" ng-if="channel.id== 101||channel.id== 102">
                <ul class="clearfix">
                    <li style="width:45%">产品名称</li>
                    <li style="width:25%">万份收益</li>
                    <li style="width:30%" class="tar">七日年化收益</li>
                </ul>
            </div>
            <a ng-if="channel.id== 101||channel.id== 102" ng-href="#/{{item.url}}/{{item.prod_code}}"
                                            class="kCell kQuota" ng-repeat="item in channel.products">
                <ul class="clearfix">
                    <li style="width:45%"><em>{{item.prod_name}}</em><i>{{item.prod_code}}</i></li>
                    <li style="width:25%"><em>{{item.prod_gain | defNumber:4}}</em></li>
                    <li style="width:30%" class="tar"><em class="inc">{{item.prod_yield | defNumber :4}}%</em></li>
                </ul>
            </a>

            <div class="kCell" ng-if="channel.id!= 101&&channel.id!= 102">
                <ul class="clearfix">
                    <li style="width:45%">产品名称</li>
                    <li style="width:25%">单位净值</li>
                    <li style="width:30%" class="tar" ng-if="!vm.price_increase_qry_type||vm.price_increase_qry_type==1">近一月涨幅</li>
                    <li style="width:30%" class="tar" ng-if="vm.price_increase_qry_type==2">近三月涨幅</li>
                    <li style="width:30%" class="tar" ng-if="vm.price_increase_qry_type==3">近半年涨幅</li>
                    <li style="width:30%" class="tar" ng-if="vm.price_increase_qry_type==4">近一年涨幅</li>
                    <li style="width:30%" class="tar" ng-if="vm.price_increase_qry_type==5">成立以来涨幅</li>
                </ul>
            </div>
            <a ng-if="channel.id!= 101&&channel.id!= 102" ng-href="#/{{item.url}}/{{item.prod_code}}"
               class="kCell kQuota" ng-repeat="item in channel.products">
                <ul class="clearfix">
                    <li style="width:45%"><em>{{item.prod_name}}</em><i>{{item.prod_code}}</i></li>
                    <li style="width:25%"><em>{{item.prod_nav | defNumber:4}}</em></li>
                    <li style="width:30%" class="tar">
                        <em class="inc" ng-if="!vm.price_increase_qry_type||vm.price_increase_qry_type==1">{{item.price_increase_month1 | number :2}}%</em>
                        <em class="inc" ng-if="vm.price_increase_qry_type==2">{{item.price_increase_month3 | number :2}}%</em>
                        <em class="inc" ng-if="vm.price_increase_qry_type==3">{{item.price_increase_month6 | number :2}}%</em>
                        <em class="inc" ng-if="vm.price_increase_qry_type==4">{{item.price_increase_thisyear | number :2}}%</em>
                        <em class="inc" ng-if="vm.price_increase_qry_type==5">{{item.price_increase_total | number :2}}%</em>
                    </li>
                </ul>
            </a>
        </div>
        <ion-infinite-scroll on-infinite="loadMore()" distance="1%" ng-if="vm.loadMore">
        </ion-infinite-scroll>
    </ion-content>
    <scroll-to-top-button animate="true">
        <a class="backTop">↑</a>
    </scroll-to-top-button>

</ion-view>